<template>
  <div id="dzgl">
    <el-table :data="tableData" style="width: 100%">
      <el-table-column prop="name" label="收货人" width="120">
      </el-table-column>
      <el-table-column prop="address" label="所在地区" width="220">
      </el-table-column>
      <el-table-column prop="jdzd" label="街道地址" width="150">
      </el-table-column>

      <el-table-column prop="lxdh" label="联系电话" width="120">
      </el-table-column>
      <el-table-column prop="bz" label="备注" width="120"> </el-table-column>

      <el-table-column label="操作">
        <template slot-scope="scope">
          <span>修改为默认地址</span>
          <el-button
            size="mini"
            @click="handleEdit(scope.$index, scope.row)"
            class="exit"
            >编辑</el-button
          >
          <el-button
            size="mini"
            type="danger"
            @click="handleDelete(scope.$index, scope.row)"
          
            
            class="del"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'dzgl',
  data() {
    return {
      tableData: [
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
        {
          name: '王小虎',
          address: '上海市普陀区金沙江路 1517 弄',
          jdzd: '你猜我住哪',
          lxdh: 12312345678,
          bz: '鬼！',
        },
      ],
    };
  },
  methods: {
  
  
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
                         this.tableData.splice(index, 1)

    },
  },
};
</script>

<style scoped>
#dzgl {
  width: 1000px;
  height: 670px;
  border: 1px solid #e7e7e7;
}
.del,
.exit {
  margin: 0 10px;

  cursor: pointer;
}
</style>
